﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WealowsHospital
{
    
    public partial class FrmAssignStaffWard : Form
    {
        WellmeadowsEntities hospital;
        public FrmAssignStaffWard()
        {
            InitializeComponent();
            hospital = new WellmeadowsEntities();
            BindStaff();
        }
        private void BindWard()
        {

        }
        private void BindStaff()
        {
            
            foreach(Staff staff in hospital.Staff.ToList())
            {
                string name = staff.StaffID + "-" + staff.FirstName + " " + staff.LastName;
                cbbStaff.Items.Add(name);
             
                
            }

        }

        private void FrmAssignStaffWard_FormClosing(object sender, FormClosingEventArgs e)
        {
            hospital.Dispose();
            
        }

        private void FrmAssignStaffWard_Load(object sender, EventArgs e)
        {
            
        }

        private void cbbStaff_SelectedIndexChanged(object sender, EventArgs e)
        {
            string str = cbbStaff.SelectedItem.ToString();
            str = str.Substring(0,str.IndexOf("-"));
            bindSourceStaff.DataSource=hospital.Staff.Where(stf => stf.StaffID == str).ToList();
        }

        private void btnAssign_Click(object sender, EventArgs e)
        {

        }

        private void chkBringCurrent_CheckedChanged(object sender, EventArgs e)
        {
            if (chkBringCurrent.Checked == true)
            {
                DialogResult result=MessageBox.Show(this,"Will Be Assign Like Last Week?","Staff Manager",MessageBoxButtons.YesNoCancel);
                if (result == DialogResult.Yes)
                {

                }
            }
            
        }
        
    }
    
}
